package no.uib.fragmentation_analyzer.gui;

import javax.swing.JOptionPane;

/**
 * A dialog that lets the user set the preferences of FragmentationAnalyzer.
 *
 * @author Harald Barsnes
 */
public class Preferences extends javax.swing.JDialog {

    private FragmentationAnalyzer fragmentationAnalyzer;

    /**
     * Creates a new Preferences dialog and makes it visible.
     *
     * @param fragmentationAnalyzer a reference to the parent frame
     * @param modal
     */
    public Preferences(FragmentationAnalyzer fragmentationAnalyzer, boolean modal) {
        super(fragmentationAnalyzer, modal);
        initComponents();

        this.fragmentationAnalyzer = fragmentationAnalyzer;

        defaultBubbleScalingJTextField.setText("" + fragmentationAnalyzer.getUserProperties().getDefaultBubbleScaling());
        ppmBubbleScalingJTextField.setText("" + fragmentationAnalyzer.getUserProperties().getPpmBubbleScaling());

        aPosterioriDetectedJCheckBox.setSelected(fragmentationAnalyzer.getUserProperties().includeAPosterioriDetected());
        detectedNotScoredJCheckBox.setSelected(fragmentationAnalyzer.getUserProperties().includeDetectedNotScoring());
        detectedAndScoredJCheckBox.setSelected(fragmentationAnalyzer.getUserProperties().includeDetectedAndScoring());

        if(fragmentationAnalyzer.getUserProperties().normalizeIntensites()){
            totalIntensityNormalizationJRadioButton.setSelected(true);
            unnormalizedJRadioButton.setSelected(false);
        } else {
            totalIntensityNormalizationJRadioButton.setSelected(false);
            unnormalizedJRadioButton.setSelected(true);
        }

        if(fragmentationAnalyzer.getUserProperties().useSpearmansCorrelation()){
            spearmanJRadioButton.setSelected(true);
            pearsonJRadioButton.setSelected(false);
        } else {
            spearmanJRadioButton.setSelected(false);
            pearsonJRadioButton.setSelected(true);
        }

        plotsPerRowJSpinner.setValue(fragmentationAnalyzer.getUserProperties().getNumberOfPlotsPerRow());
        plotsPerColumnJSpinner.setValue(fragmentationAnalyzer.getUserProperties().getNumberOfPlotsPerColumn());
        
        setLocationRelativeTo(fragmentationAnalyzer);
        setVisible(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        normalizationButtonGroup = new javax.swing.ButtonGroup();
        correlationButtonGroup = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        defaultBubbleScalingJTextField = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        ppmBubbleScalingJTextField = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        plotsPerRowJSpinner = new javax.swing.JSpinner();
        plotsPerColumnJSpinner = new javax.swing.JSpinner();
        okJButton = new javax.swing.JButton();
        cancelJButton = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jPanel2 = new javax.swing.JPanel();
        aPosterioriDetectedJCheckBox = new javax.swing.JCheckBox();
        detectedNotScoredJCheckBox = new javax.swing.JCheckBox();
        detectedAndScoredJCheckBox = new javax.swing.JCheckBox();
        jPanel3 = new javax.swing.JPanel();
        totalIntensityNormalizationJRadioButton = new javax.swing.JRadioButton();
        unnormalizedJRadioButton = new javax.swing.JRadioButton();
        jPanel4 = new javax.swing.JPanel();
        spearmanJRadioButton = new javax.swing.JRadioButton();
        pearsonJRadioButton = new javax.swing.JRadioButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Preferences");
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Plotting Properties"));

        jLabel1.setText("Default Bubble Scaling Size:");
        jLabel1.setToolTipText("<html>\nThe scale used when determining the size<br>\nof the bubbles in a bubble plot using the<br>\nabsolute distance measurment, i.e. Da.\n<html> ");

        defaultBubbleScalingJTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        defaultBubbleScalingJTextField.setToolTipText("<html>\nThe scale used when determining the size<br>\nof the bubbles in a bubble plot using the<br>\nabsolute distance measurment, i.e. Da.\n<html> ");

        jLabel2.setText("PPM Bubble Scaling Size:");
        jLabel2.setToolTipText("<html>\nThe scale used when determining the size<br>\nof the bubbles in a bubble plot using the<br>\nrelative distance measurment, i.e. ppm.\n<html> ");

        ppmBubbleScalingJTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        ppmBubbleScalingJTextField.setToolTipText("<html>\nThe scale used when determining the size<br>\nof the bubbles in a bubble plot using the<br>\nrelative distance measurment, i.e. ppm.\n<html> ");

        jLabel3.setText("Number of Plots Per Row:");
        jLabel3.setToolTipText("<html>\nThe number of plots shown per row in the Plots/Analyses panel.\n<html> ");

        jLabel4.setText("Number of Plots Per Column:");
        jLabel4.setToolTipText("<html>\nThe number of plots shown per column in the Plots/Analysis panel.\n<html> ");

        plotsPerRowJSpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(2), Integer.valueOf(1), null, Integer.valueOf(1)));
        plotsPerRowJSpinner.setToolTipText("<html>\nThe number of plots shown per row in the Plots/Analyses panel.\n<html> ");

        plotsPerColumnJSpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(2), Integer.valueOf(1), null, Integer.valueOf(1)));
        plotsPerColumnJSpinner.setToolTipText("<html>\nThe number of plots shown per column in the Plots/Analysis panel.\n<html> ");

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel1)
                    .add(jLabel2)
                    .add(jLabel4)
                    .add(jLabel3))
                .add(9, 9, 9)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(plotsPerColumnJSpinner, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
                    .add(defaultBubbleScalingJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
                    .add(ppmBubbleScalingJTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, plotsPerRowJSpinner, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(defaultBubbleScalingJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(ppmBubbleScalingJTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel3)
                    .add(plotsPerRowJSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel4)
                    .add(plotsPerColumnJSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        okJButton.setText("OK");
        okJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okJButtonActionPerformed(evt);
            }
        });

        cancelJButton.setText("Cancel");
        cancelJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelJButtonActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Fragment Ion Scoring Types - ms_lims"));

        aPosterioriDetectedJCheckBox.setText("A Posteriori Detected");
        aPosterioriDetectedJCheckBox.setToolTipText("<html>\nFragment ions that are only found after identification, when the spectra<br>\nare analyzed in detail to specifically retrieve all theoretical fragment ions<br> \ncalculated from the identified peptide.\n</html>");
        aPosterioriDetectedJCheckBox.setIconTextGap(15);

        detectedNotScoredJCheckBox.setText("Detected yet Not Scored");
        detectedNotScoredJCheckBox.setToolTipText("<html>\nFragment ions that are found by the search algorithm<br>\nduring identification, but do not contribute to the score.\n</html>");
        detectedNotScoredJCheckBox.setIconTextGap(15);

        detectedAndScoredJCheckBox.setText("Detected and Scored");
        detectedAndScoredJCheckBox.setToolTipText("<html>\nFragment ions that are found by the search algorithm<br>\nduring identification and contribute to the score.\n</html>");
        detectedAndScoredJCheckBox.setIconTextGap(15);

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(detectedAndScoredJCheckBox)
                    .add(detectedNotScoredJCheckBox)
                    .add(aPosterioriDetectedJCheckBox))
                .addContainerGap(168, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(detectedAndScoredJCheckBox)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(detectedNotScoredJCheckBox)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(aPosterioriDetectedJCheckBox)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Intensity Normalization"));

        normalizationButtonGroup.add(totalIntensityNormalizationJRadioButton);
        totalIntensityNormalizationJRadioButton.setText("Total Intensity Normalization");
        totalIntensityNormalizationJRadioButton.setToolTipText("<html>Divide the intensity values by the total intensity of the spectrum</html>");
        totalIntensityNormalizationJRadioButton.setIconTextGap(15);

        normalizationButtonGroup.add(unnormalizedJRadioButton);
        unnormalizedJRadioButton.setText("Unnormalized");
        unnormalizedJRadioButton.setToolTipText("<html>No normalization, use the unnormalized intensity values</html>");
        unnormalizedJRadioButton.setIconTextGap(15);

        org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(totalIntensityNormalizationJRadioButton)
                    .add(unnormalizedJRadioButton))
                .addContainerGap(142, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .add(totalIntensityNormalizationJRadioButton)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(unnormalizedJRadioButton)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Heat Map Correlation Type"));

        correlationButtonGroup.add(spearmanJRadioButton);
        spearmanJRadioButton.setText("Spearman Correlation");
        spearmanJRadioButton.setIconTextGap(15);

        correlationButtonGroup.add(pearsonJRadioButton);
        pearsonJRadioButton.setText("Pearson Correlation");
        pearsonJRadioButton.setIconTextGap(15);

        org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(spearmanJRadioButton)
                    .add(pearsonJRadioButton))
                .addContainerGap(180, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .add(spearmanJRadioButton)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(pearsonJRadioButton)
                .addContainerGap(10, Short.MAX_VALUE))
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 365, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                        .add(okJButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(cancelJButton)))
                .addContainerGap())
        );

        layout.linkSize(new java.awt.Component[] {cancelJButton, okJButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL);

        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(cancelJButton)
                    .add(okJButton))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Closes the dialog.
     *
     * @param evt
     */
    private void cancelJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelJButtonActionPerformed
        this.setVisible(false);
        this.dispose();
    }//GEN-LAST:event_cancelJButtonActionPerformed

    /**
     * Verifies that the inserted values are valid, then closes the dialog.
     *
     * @param evt
     */
    private void okJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okJButtonActionPerformed

        boolean error = false;

        try {
            fragmentationAnalyzer.getUserProperties().setDefaultBubbleScaling(new Integer(defaultBubbleScalingJTextField.getText()));
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(this,
                    "Bubble scaling value has to be an integer.",
                    "Bubble Scaling", JOptionPane.INFORMATION_MESSAGE);
            defaultBubbleScalingJTextField.requestFocus();
            error = true;
        }

        if (!error) {
            try {
                fragmentationAnalyzer.getUserProperties().setPpmBubbleScaling(new Integer(ppmBubbleScalingJTextField.getText()));
            } catch (NumberFormatException e) {
                JOptionPane.showMessageDialog(this,
                        "Bubble scaling value has to be an integer.",
                        "Bubble Scaling", JOptionPane.INFORMATION_MESSAGE);
                ppmBubbleScalingJTextField.requestFocus();
                error = true;
            }
        }

        if(!error){
            if(!aPosterioriDetectedJCheckBox.isSelected() &&
                    !detectedNotScoredJCheckBox.isSelected() &&
                    !detectedAndScoredJCheckBox.isSelected()){
                JOptionPane.showMessageDialog(this,
                        "Please select at least one fragment ion scoring type.",
                        "Fragment Ion Scoring", JOptionPane.INFORMATION_MESSAGE);
                error = true;
            } else{
                fragmentationAnalyzer.getUserProperties().setIncludeAPosterioriDetected(aPosterioriDetectedJCheckBox.isSelected());
                fragmentationAnalyzer.getUserProperties().setDetectedNotScoring(detectedNotScoredJCheckBox.isSelected());
                fragmentationAnalyzer.getUserProperties().setDetectedAndScoring(detectedAndScoredJCheckBox.isSelected());
            }
        }
        
        if(!error){
            fragmentationAnalyzer.getUserProperties().setNormalizeIntensites(totalIntensityNormalizationJRadioButton.isSelected());
        }
        
        if(!error){
            try{
                fragmentationAnalyzer.getUserProperties().setNumberOfPlotsPerRow(
                        ((Integer) plotsPerRowJSpinner.getValue()).intValue());
            } catch(NumberFormatException e){
                JOptionPane.showMessageDialog(this,
                        "Number of plots per row has to be an integer.",
                        "Plots Per Row", JOptionPane.INFORMATION_MESSAGE);
                plotsPerRowJSpinner.requestFocus();
                error = true;
            }
        }

        if(!error){
            try{
                fragmentationAnalyzer.getUserProperties().setNumberOfPlotsPerColumn(
                        ((Integer) plotsPerColumnJSpinner.getValue()).intValue());
            } catch(NumberFormatException e){
                JOptionPane.showMessageDialog(this,
                        "Number of plots per column has to be an integer.",
                        "Plots Per Column", JOptionPane.INFORMATION_MESSAGE);
                plotsPerRowJSpinner.requestFocus();
                error = true;
            }
        }

        if(!error){
            fragmentationAnalyzer.getUserProperties().setUseSpearmansCorrelation(
                    spearmanJRadioButton.isSelected());
        }

        // update the order and size of the internal frames
        fragmentationAnalyzer.orderInternalFrames();
        
        fragmentationAnalyzer.getUserProperties().saveUserPropertiesToFile();

        if (!error) {
            cancelJButtonActionPerformed(null);
        }
    }//GEN-LAST:event_okJButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox aPosterioriDetectedJCheckBox;
    private javax.swing.JButton cancelJButton;
    private javax.swing.ButtonGroup correlationButtonGroup;
    private javax.swing.JTextField defaultBubbleScalingJTextField;
    private javax.swing.JCheckBox detectedAndScoredJCheckBox;
    private javax.swing.JCheckBox detectedNotScoredJCheckBox;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.ButtonGroup normalizationButtonGroup;
    private javax.swing.JButton okJButton;
    private javax.swing.JRadioButton pearsonJRadioButton;
    private javax.swing.JSpinner plotsPerColumnJSpinner;
    private javax.swing.JSpinner plotsPerRowJSpinner;
    private javax.swing.JTextField ppmBubbleScalingJTextField;
    private javax.swing.JRadioButton spearmanJRadioButton;
    private javax.swing.JRadioButton totalIntensityNormalizationJRadioButton;
    private javax.swing.JRadioButton unnormalizedJRadioButton;
    // End of variables declaration//GEN-END:variables
}
